/* bsp_config.h */

#ifndef __BSP_CONFIG_H__
#define __BSP_CONFIG_H__

#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>

/*
* Clock.
*/
#define BSP_CLK_CORECLK_HZ      120000000UL
#define BSP_CLK_BUSCLK_HZ       60000000UL
#define BSP_TICKERS_PER_SECOND  200UL

/*
* GPIO LEDs.
*/
#define BSP_GPIO_LED1_PORT  PTE
#define BSP_GPIO_LED1_PIN   6U
#define BSP_GPIO_LED2_PORT  PTE
#define BSP_GPIO_LED2_PIN   7U
#define BSP_GPIO_LED3_PORT  PTE
#define BSP_GPIO_LED3_PIN   11U
#define BSP_GPIO_LED4_PORT  PTE
#define BSP_GPIO_LED4_PIN   12U

/*
* GPIO Keys.
*/
#define BSP_GPIO_KEY1_PORT  PTE
#define BSP_GPIO_KEY1_PIN   26U
#define BSP_GPIO_KEY2_PORT  PTE
#define BSP_GPIO_KEY2_PIN   27U
#define BSP_GPIO_KEY3_PORT  PTA
#define BSP_GPIO_KEY3_PIN   4U

/*!
 * @brief Do board initializaton.
 *
 * This function initializes the basic board system, including: 
 * - Enable all the PORT's clock.
 * - Update the Core clock record value.
 *
 * @return Core clock frequency in Hz.
 */
uint32_t BSP_InitSystem(void);

/*!
 * @brief Initialize debug UART terminal port.
 *
 * @param baudrate Setting UART baudrate.
 */
void BSP_InitStdioUART(uint32_t baudrate);

/*!
 * @brief Initialize the GPIO for LEDs.
 */
void BSP_InitLEDGPIO(void);

/*!
 * @brief Initialize the GPIO for Keys.
 */
void BSP_InitKeyGPIO(void);

#endif /* __BSP_CONFIG_H__ */

